<template>
<span :class="wrapper_name">
    <button v-if="col.btns.COPY" class="ui button primary mini icon circular" @click.stop.prevent="to_copy(col.val)" :title="col.btns.COPY">
      <i class="icon copy"></i>
    </button>
  <button v-if="col.btns.ADDWH" class="ui button primary mini" @click.stop.prevent="add_wh(col.val)" title="添加到的仓库">
    {{col.btns.ADDWH}}
  </button>
</span>
</template>
<script type="text/ecmascript-6">
import tool from 'src/util/tool';
import util from '_util/index';

export default {
    data() {
        return {}
    },
    methods: {
        add_wh(id) {
            this.$router.push(`/page/add?ctl=addWarehousePro&product_id=${id}`);
        },
        to_copy(id) {
            this.$router.push('/page/edit?ctl=Product&flag=copy&_id=' + id);
        },
    },
    computed: {
        ctl() {
            return this.$route.query.ctl;
        },
        is_admin() {
            return util.is_admin(this);
        }
    },
    watch: {},

    props: ['col', '_id', 'detail_info', 'wrapper_name'],
    created() {

	},
}
</script>
<style rel="stylesheet/less" lang="less"></style>
